﻿using System;

namespace BookStore
{
    class InsufficientStockException<T>: Exception
    {
/*  Define a class InsufficientStockException<T> that holds information about an error condition
    related to insufficient quantity of a requested item in the warehouse.   */

        private const string InsufficientQuantityMessage = "Insufficient/not available quantity";

        public T ItemId { get; private set; }
        public T Quantity { get; private set; }

        public InsufficientStockException(T itemId, T quantity, Exception innerException = null)
            : base(InsufficientQuantityMessage, innerException)
        {
            this.ItemId = itemId;
            this.Quantity = quantity;
        }
    }
}
